﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using Castle.Windsor;

namespace Mammoth.Services
{
    public class ViewFactory : IViewFactory
    {
        private IWindsorContainer container;

        public ViewFactory(IWindsorContainer container)
        {
            this.container = container;
        }

        public UIElement CreateByType(Type type)
        {
            return (UIElement) container.Resolve(type);
        }


        public T Create<T>() where T : UIElement
        {
            return (T)container.Resolve(typeof(T));
        }
    }
}
